var layer;
var $;
var element;
var form;
var laydate;
var table;
var upload;
layui.use(['element','layer','laydate','form','table','upload'], function(){
    layer = layui.layer;
    $ = layui.jquery;
    element = layui.element;
    form = layui.form;
    laydate = layui.laydate;
    table = layui.table;
    upload = layui.upload;
    laydate.render({
        elem: '#entranceDate', //指定元素
        type: 'datetime',
        trigger: 'click' //时间时间为点击事件
    });
    laydate.render({
        elem: '#graduationDate', //指定元素
        type: 'datetime',
        trigger: 'click' //时间时间为点击事件
    });
    load();
    //监听 type状态  如何为2毕业时间不可以编译  为3可以编译
    form.on('select(type)', function(data){
        if(data.value==2){
            $("#graduationDate").attr("disabled","disabled");
            $("#entranceDate").removeAttr("disabled");
        }else if(data.value==3){
            $("#graduationDate").removeAttr("disabled");
            $("#entranceDate").removeAttr("disabled");
        }
    })
})
function load(){
    var avatarUrl = $("input[name=avatarUrl]").val();
    var photoImg = $("input[name=photoImg]").val();
    $(".img_title").attr("src",avatarUrl+photoImg);
}
